﻿using System.Collections.Generic;
using Close.io.Client;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Close.io.API
{
	public class Email : Activity, IIdentifiable
	{
		[JsonProperty(PropertyName = "body_text")]
		public string BodyText { get; set; }

		[JsonProperty(PropertyName = "need_smtp_credentials")]
		public bool? NeedSMTPCredentials { get; private set; }

		[JsonProperty(PropertyName = "to")]
		public IEnumerable<string> To { get; set; }

		[JsonProperty(PropertyName = "subject")]
		public string Subject { get; set; }

		[JsonProperty(PropertyName = "opens")]
		public IEnumerable<object> Opens { get; private set; }

		[JsonProperty(PropertyName = "status")]
		public string Status { get; set; }

		[JsonProperty(PropertyName = "envelope")]
		public Envelope Envelope { get; private set; }

		[JsonProperty(PropertyName = "body_html")]
		public string BodyHTML { get; set; }

		[JsonProperty(PropertyName = "body_text_quoted")]
		public IEnumerable<BodyText> BodyTextQuoted { get; private set; }

		[JsonProperty(PropertyName = "send_attempts")]
		public IEnumerable<object> SendAttempts { get; private set; }

		[JsonProperty(PropertyName = "sender")]
		public string Sender { get; private set; }

		[JsonProperty(PropertyName = "cc")]
		public IEnumerable<KeyValuePair<string, string>> CC { get;   set; }

		[JsonProperty(PropertyName = "bcc")]
		public IEnumerable<KeyValuePair<string, string>> BCC { get;   set; }

		[JsonProperty(PropertyName = "templated_id")]
		public string TemplateId { get; set; }
	}
}